[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 floodfill()             Fill a Bounded Region

 #include   <graphics.h>

 void far   floodfill(x,y,border);
 int        x;
 int        y;
 int        border;

    floodfill() fills figures drawn using arc(), circle(), ellipse(),
    drawpoly(), line(), lineto(), linerel() and rectangle(). The bounded
    area is filled with the current fill pattern and fill color. The
    coordinates ('x','y') represent a point within the area to be
    flooded.  If the point is within an enclosed area, the area inside
    the border will be filled.  If the point is outside an enclosed area,
    the area outside the border will be filled.

    Returns:    Nothing. If coded, graphresult() returns a value of -7
                (out of memory in flood fill) if an error occurs while
                flood filling an area.

       Note:    floodfill() is not supported by the IBM8514 driver.

   -------------------------------- Example ---------------------------------

    The following statements draw a rectangle and fill it.

           #include <graphics.h>
           #include <conio.h>

           main()
           {
               int gdriver = DETECT;
               int gmode;

               initgraph(&gdriver,&gmode,"");
               setfillstyle(SOLID_FILL,GREEN);
               rectangle(100,100,200,200);
               floodfill(150,150,WHITE);
               getch();
               closegraph();
           }


See Also: fillpoly() setfillstyle() getfillsettings()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson